Learn R Programming

Compositional (version 5.5)

Unconstrained log-contrast regression with multiple compositional predictors: Unconstrained log-contrast regression with multiple compositional predictors

Description

Unconstrained log-contrast regression with multiple compositional predictors.

Usage

ulc.reg2(y, x, z = NULL, xnew = NULL, znew = NULL)

Arguments

y

A numerical vector containing the response variable values. This must be a continuous variable.

x

A list with multiple matrices with the predictor variables, the compositional data. No zero values are allowed.

z

A matrix, data.frame, factor or a vector with some other covariate(s).

xnew

A matrix containing a list with multiple matrices with compositional data whose response is to be predicted. If you have no new data, leave this NULL as is by default.

znew

A matrix, data.frame, factor or a vector with the values of some other covariate(s). If you have no new data, leave this NULL as is by default.

Value

A list including:

be

The constrained regression coefficients. Their sum equals 0.

covbe

If covariance matrix of the constrained regression coefficients.

va

The estimated regression variance.

residuals

The vector of residuals.

est

If the arguments "xnew" and "znew" were given these are the predicted or estimated values, otherwise it is NULL.

Details

The function performs the unconstrained log-contrast regression model as opposed to the log-contrast regression described in Aitchison (2003), pg. 84-85. The logarithm of the compositional predictor variables is used (hence no zero values are allowed). The response variable is linked to the log-transformed data without the constraint that the sum of the regression coefficients equals 0. If you want the regression model with the zum-to-zero contraints see lc.reg2. Extra predictors variables are allowed as well, for instance categorical or continuous. Similarly to lc.reg2 there are multiple compositions treated as predictor variables.

References

Aitchison J. (1986). The statistical analysis of compositional data. Chapman & Hall.

Xiaokang Liu, Xiaomei Cong, Gen Li, Kendra Maas and Kun Chen (2020). Multivariate Log-Contrast Regression with Sub-Compositional Predictors: Testing the Association Between Preterm Infants' Gut Microbiome and Neurobehavioral Outcome. https://arxiv.org/pdf/2006.00487.pdf.

See Also

lc.reg2, ulc.reg, lc.reg, alfa.pcr, alfa.knn.reg

Examples

Run this code
# NOT RUN {
y <- iris[, 1]
x <- list()
x1 <- as.matrix(iris[, 2:4])
x1 <- x1 / rowSums(x1)
x[[ 1 ]] <- x1
x[[ 2 ]] <- rdiri(150, runif(4) )
x[[ 3 ]] <- rdiri(150, runif(5) )
mod <- lc.reg2(y, x)
# }

Run the code above in your browser using DataLab